<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            overflow: hidden;
            width: 640px;
        }
        .box div{
            width: 100px;
            float: left;
            height: 100px;
            margin-right: 5px;
            text-align: center;
            line-height: 100px;
        }
        .box .focus{
            background-color: red;
            color: #fff;
        }
        .box .remove{
            background-color: #eee;
        }
    </style>
    <script src="../lib/jquery-1.11.3.min.js"></script>
</head>
<body>
    <div class="box">
        <div id="a" class="focus">A</div>
        <div id="b" class="focus">B</div>
        <div id="c" class="focus">C</div>
        <div id="d" class="focus">D</div>
        <div id="e" class="focus">E</div>
        <div id="f" class="focus">F</div>
    </div>
    <script>
        $('.box div').each(function(index,item){
            console.log(index,item)
            $(this).on('click',function(){
                $('.box div').removeClass('remove').addClass('focus')
                $(this).removeClass('focus').addClass('remove')
            })
        })
    </script>
</body>
</html>